/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package engine;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import server.Reminder;
import server.Server;

/**
 *
 * @author User
 */
public class Player {
  private String login = null;
  private Server srv;
  private Socket socket;
  public BufferedReader in;
  public PrintWriter out;
  public boolean state = true;
  public Player(){
    
  }
  
  public Player(Server srv, Socket socket) throws IOException{
    this.srv = srv;
    this.socket = socket;
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);
    new Reminder(2440, this.srv); // может убить весь сервер end end
  }
  
  public Player(Server srv){
    this.srv = srv;
    new Reminder(2440, this.srv); // может убить весь сервер end end
  }
  
   public void setLogin(String login)
    {
      this.login = login;
    }
    
    public String getLogin()
    {
      return login;
    }
    
    public Server getSocket()
    {
      return srv;
    }
    
    public Socket getSok()
    {
      return socket;
    }
  
}
